package net.roseparadise.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Cascade;
import org.hibernate.annotations.CascadeType;
import org.hibernate.annotations.GenericGenerator;

/**
 * Photo entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name="talbum"
    ,catalog="studio"
)

public class Album {
	 // Fields    


    private Integer albumid;
    private String isstudio;
    private Member member;
    private Integer memberid;
	private String createdate;
    private String albumname;
    private Integer albumorder;


   // Constructors


/** default constructor */
   public Album() {
   }

   
   /** full constructor */
   public Album(String isstudio, Member member, String createdate, String albumname, Integer albumorder ) {
  
       this.isstudio = isstudio;
       this.member = member;
       this.createdate = createdate;
       this.albumname = albumname;  
       this.albumorder = albumorder;  
   }
   public Album(String isstudio, Integer memberid, String createdate, String albumname, Integer albumorder ) {
	   
       this.isstudio = isstudio;
       this.memberid = memberid;
       this.createdate = createdate;
       this.albumname = albumname;  
       this.albumorder = albumorder;  
   }
  

   @GenericGenerator(name="generator", strategy="increment")
   @Id
   @GeneratedValue(generator="generator")
   
   @Column(name="ALBUMID", unique=true, nullable=false)

   public Integer getAlbumid() {
       return this.albumid;
   }
   
   public void setAlbumid(Integer albumid) {
       this.albumid = albumid;
   }
   
   @Column(name="ISSTUDIO", nullable=false, length=1)

   public String getIsstudio() {
       return this.isstudio;
   }
   
   public void setIsstudio(String isstudio) {
       this.isstudio = isstudio;
   }
   
   @Column(name="MEMBERID", nullable=false, length=10)
   public Integer getMemberid() {
		return memberid;
	}
   public void setMemberid(Integer memberid) {
		this.memberid = memberid;
	}
	
   @OneToOne() 
   @Cascade(value=CascadeType.REFRESH ) 
   @JoinColumn(name="MEMBERID",referencedColumnName="ID",unique=true, insertable=false, updatable=false) 
   public Member getMember() {
       return this.member;
   }
   
   public void setMember(Member member) {
       this.member = member;
   }
   
   @Column(name="CREATEDATE", nullable=false, length=14)

   public String getCreatedate() {
       return this.createdate;
   }
   
   public void setCreatedate(String createdate) {
       this.createdate = createdate;
   }
   
   @Column(name="ALBUMNAME", nullable=false, length=100)

   public String getAlbumname() {
       return this.albumname;
   }
   
   public void setAlbumname(String albumname) {
       this.albumname = albumname;
   }
   
   @Column(name="ALBUMORDER", nullable=false, length=100)

   public Integer getAlbumorder() {
		return albumorder;
	}


	public void setAlbumorder(Integer albumorder) {
		this.albumorder = albumorder;
	}

  
}
